package com.lzq.model.factory.before;

/**
 * @author : modify
 * @version : v1.0
 * @description :
 * @createTime : 2022/11/15 9:22
 * @updateUser : modify
 * @updateTime : 2022/11/15 9:22
 * @updateRemark : 咖啡工厂类
 */
public class CoffeeFactory {
    private static final String LATTE_COFFEE = "LatteCoffee";
    private static final String USA_COFFEE = "UsaCoffee";

    public Coffee createCoffee(String type) {
        Coffee coffee;
        if ((LATTE_COFFEE).equals(type)) {
            coffee = new LatteCoffee();
        } else if ((USA_COFFEE).equals(type)) {
            coffee = new UsaCoffee();
        } else {
            throw new RuntimeException("not exist");
        }
        return coffee;
    }
}
